<template>
  <div class="mapAction">
    mapAction的使用
    <button @click="add">+1</button>
    <button @click="increment">-1</button>
    <button @click="addTWO(5)">+5</button>
    <button @click="incrementAction1(5)">-5</button>
    <button @click="add1(10)">+10</button>
    <button @click="increment1(10)">-10</button>
    <hr>
    <div>
      <set-up-actions></set-up-actions>
    </div>
  </div>
</template>
<script>
import { mapActions } from 'vuex'
import SetUpActions from './setUpActions'
export default {
  components: {
    SetUpActions
  },
  methods: {
    add () {
      this.$store.dispatch('addTWO', 1)
    },
    increment () {
      this.$store.dispatch('incrementAction1', 1)
    },
    ...mapActions(['addTWO', 'incrementAction1']),
    ...mapActions({
      add1: 'addTWO',
      increment1: 'incrementAction1'
    })
  }
}
</script>
<style scoped>
</style>
